package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2020-10-16
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_customer_privilege")
@ApiModel(value = "CustomerPrivilege", description = "")
@AllArgsConstructor
public class CustomerPrivilege extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "")
    @NotNull(message = "不能为空")
    @TableField("customer_id")
    @Excel(name = "")
    private Long customerId;

    /**
     * 对应价格专区
     */
    @ApiModelProperty(value = "对应价格专区")
    @NotNull(message = "对应价格专区不能为空")
    @TableField("price_id")
    @Excel(name = "对应价格专区")
    private Long priceId;

    @ApiModelProperty(value = "")
    @NotNull(message = "不能为空")
    @TableField("spell_id")
    @Excel(name = "")
    private Long spellId;

    /**
     * 赠送免中特权次数
     */
    @ApiModelProperty(value = "赠送免中特权次数")
    @TableField("give_num")
    @Excel(name = "赠送免中特权次数")
    private Integer giveNum;

    @ApiModelProperty(value = "")
    @TableField("used_num")
    @Excel(name = "")
    private Integer usedNum;
    @TableField(exist = false)
    private Customer customer;
    @TableField(exist = false)
    private SpellPrice spellPrice;


    @Builder
    public CustomerPrivilege(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser, 
                    Long customerId, Long priceId, Long spellId, Integer giveNum, Integer usedNum) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.customerId = customerId;
        this.priceId = priceId;
        this.spellId = spellId;
        this.giveNum = giveNum;
        this.usedNum = usedNum;
    }

}
